package com.gitee.zeric.codec.generaters;

import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zj
 * @date 2021/12/13
 * 随机数生成器
 */
@Slf4j
public class RandomGenerater extends AbstractCodeGerator {

    @Override
    public String generate(String ruleCode,JSONObject param)  {
        Integer size = param.getInteger("size");
       return RandomUtil.randomNumbers(size);
    }

    @Override
    protected String[] fields() {
        return new String[]{"size"};
    }
}
